<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('新增跟踪类型')" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-tracker-add">
            <div class="col-xs-12">
                <div class="form-group">
                    <label class="col-sm-3 control-label is-required">跟踪类型名称：</label>
                    <div class="col-sm-8">
                        <input name="name" class="form-control" type="text" required>
                    </div>
                </div>
            </div>
            <div class="col-xs-12">
                <div class="form-group">
                    <label class="col-sm-3 control-label is-required">是否显示在变更日志中：</label>
                    <div class="col-sm-8">
                        <input name="isInChlog" class="form-control" type="text" required>
                    </div>
                </div>
            </div>
			<div class="col-xs-12">
				<div class="form-group">
					<label class="col-sm-3 control-label" title="单击选择需要使用的FontAwesome图标">图标：<i class="fa fa-question-circle-o"></i></label>
					<div class="col-sm-8">
						<input id="icon" name="icon" class="form-control" type="text" placeholder="选择图标">
				        <div class="ms-parent" style="width: 100%;">
				            <div class="icon-drop animated flipInX" style="display: none;max-height:200px;overflow-y:auto">
				                <div data-th-include="system/menu/icon"></div>
				            </div>
				        </div>
					</div>
				</div>
			</div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var prefix = ctx + "project/tracker"
        $("#form-tracker-add").validate({
            focusCleanup: true
        });
		$(function() {
			$("input[name='icon']").focus(function() {
		        $(".icon-drop").show();
		    });
			$(".icon-drop").find(".ico-list i").on("click", function() {
				$('#icon').val($(this).attr('class'));
			});
		});


        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/add", $('#form-tracker-add').serialize());
            }
        }
    </script>
</body>
</html>